# 主页面
import time

from appium import webdriver
from appium.options.common import AppiumOptions
from appium.webdriver.common.appiumby import AppiumBy

from basic.base_page import BasePage
from page.page_shopping.page_entrance_new_arrivals_MI import PageNewArrivalsMI


class PageMain(BasePage):

    def goto_new_arrivals(self):
        from page.page_shopping.page_entrance_new_arrivals_MI import PageNewArrivalsMI
        locator = "new UiSelector().resourceId(\"com.xiaomi.shop:id/image\").instance(0)"
        # 点击小米上新
        self._click(locator)
        return PageNewArrivalsMI()

    def goto_publish(self):
        pass

    def goto_classify(self):
        locator = "new UiSelector().text(\"分类\")"
        self._click(locator)
        return self

    def goto_mine(self):
        pass


if __name__ == '__main__':
    main = PageMain()
    main.goto_new_arrivals()
